﻿using System;
using ApiConceptsFramework;
using FluentAssertions;
using NUnit.Framework;
using System.Collections.Generic;
using System.Linq;

namespace test.ApiConceptsFramework
{
	[TestFixture]
	public class LearningEffectTests
	{
		[Test, Sequential]
		public void LearningEffect_Search(
			[Values(0, 1, 2, 10)] int prevUsages,
			[Values(10.0f, 2.0f, 0.0f, 0.0f)] float expectedResult)
		{
			LearningEffect.Search.CalculateComplexity(10, 1, prevUsages).Should().Be(expectedResult);

		}

		[Test, Sequential]
		public void LearningEffect_Usage(
			[Values(0, 1, 2, 10)] int prevUsages,
			[Values(10.0f, 8.0f, 6.0f, 6.0f)] float expectedResult)
		{
			LearningEffect.Usage.CalculateComplexity(10, 1, prevUsages).Should().Be(expectedResult);

		}

		[Test, Sequential]
		public void LearningEffect_from_multiple_usages(
			[Values(1, 2, 3)] int usages,
			[Values(9,11.5f,14)] float expectedResult)
		{
			var learningEffect = new LearningEffect(0.5f, 5);
			const int previousUsages = 1;
			learningEffect.CalculateComplexityForMultipleUsages(10, usages, previousUsages).Should().Be(expectedResult);
		}
	}
}
